<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>FLex</title>
    <style>
        .container {
            display: flex;
            justify-content:space-between;
            align-items: center;
            flex-wrap: wrap;
            border: 1px solid #000;
        }
        .box{
            width: 100px;
            height: 100px;
            background: pink;
        }

        .container .box:nth-child(n) {
            background-color: aquamarine;
        }

        .container .box:nth-child(2n) {
            background-color: blue;
        }

        .container .box:nth-child(3n) {
            background-color: coral;
        }
    </style>
</head>
<body>
<div class="container">
    <div class="box"></div>
    <div class="box"></div>
    <div class="box"></div>
    <div class="box"></div>
</div>


<div class="container">
    <div class="box"></div>
    <div class="box"></div>
    <div class="box"></div>
    <div class="box"></div>
</div>
</body>
</html>
